package com.fnic.wifi.threadLocal.hibernate;

public class THibernate implements Runnable {

	@Override
	public void run() {
		while (true) {
			try {
				String currentThreadName = Thread.currentThread().getName();
				System.out.println("thread " + currentThreadName +"|tlocal:"+HibernateUtil.currentSession()+"|common:"+HibernateUtil.currentSessionError());
				Thread.sleep(1000);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}

	public static void main(String[] args) {
		THibernate t=new THibernate();
		Thread t1 = new Thread(t, "t1");
		Thread t2 = new Thread(t, "t2");
		t1.start();
		t2.start();
	}
}
